//
//  VisitorView.swift
//  WeiBo
//
//  Created by LTX on 2016/11/1.
//  Copyright © 2016年 LTX. All rights reserved.
//

import UIKit

class VisitorView: UIView {

    class  func visitView() -> VisitorView {
        
            return Bundle.main.loadNibNamed("VisitorView", owner: nil, options: nil)?.first as! VisitorView
    }
    
    @IBOutlet weak var backImage: UIImageView!
    
    @IBOutlet weak var image: UIImageView!
    
    @IBOutlet weak var tipsLabel: UILabel!
    
    @IBOutlet weak var registerBtn: UIButton!
    
    @IBOutlet weak var loginBtn: UIButton!

    
    // MARK:- 设置访客视图信息
    func setVisitorViewInfo(_ imageName: String, tipsTitle: String) -> Void {
        
        image.image = UIImage(named: imageName)
        tipsLabel.text = tipsTitle
        backImage.isHidden = true
        
        
    }
    
    //添加动画
    func addBackViewAnim(){
        
        let backAnim = CABasicAnimation(keyPath: "transform.rotation.z")
        backAnim.fromValue = 0
        backAnim.toValue = M_PI * 2
        backAnim.repeatCount = MAXFLOAT
        backAnim.duration = 20
        backAnim.isRemovedOnCompletion = false
        
        backImage.layer.add(backAnim, forKey: nil)
        
    }
    
    
}
